program define sigstar, rclass
syntax [anything], [p(real 0)] [se(real 0)] [b(real 0)] [n(real 1000000)] [prec(real 0)] [bstar] [sestar] [pstar] [nopar] [pbrackets] [sebrackets] [dropstar]


	if "`anything'" != "" {
	
	cap noi lincom `anything'
	if _rc==0 {
	
		loc b = `r(estimate)'
		loc se = `r(se)'
		loc p = `r(p)'
	}
	}
*quietly {

	if "`p'" == "." | "`p'" == "" {

		return loc bstar = " "
		return loc sestar = " "
		return loc pstar = " "

	}

	else  {

		if `p' < 0.01 &  "`dropstar'" == "" loc star = "\sym{***}"
		else if `p' < 0.05 &  "`dropstar'" == "" loc star = "\sym{**}"
		else if `p' < 0.10 &  "`dropstar'" == "" loc star = "\sym{*}"
		
		if "`prec'" == "" loc prec = 3

		return loc bstar = string(`b', "%9.`prec'f") + "`star'"
		return loc sestar = "(" + string(`se', "%9.`prec'f") + ")"
		if "`sebrackets'"!="" return loc sestar = "[" + string(`se', "%9.`prec'f") + "]"

		loc pstar = string(`p', "%9.`prec'f")
		if "`pstar'" != "" loc pstar = "`pstar'" + "`star'"
		if "`pbrackets'" != "" loc pstar = "[" + "`pstar'" + "]"
		return loc pstar = "`pstar'"

*	}


}

end
